// 导入组件
import Vue from "vue";
import Router from "vue-router";
// 登录
import login from "@/views/login";
// 注册
import register from "@/views/register";
// 首页
import index from "@/views/index";
//  首页概览
import thinking from "@/views/charts/thinking";
// 题库统计分析
import bankanalysis from "@/views/charts/bankanalysis";
//题库关联资源 
import resource from "@/views/resource/resource";
// 题库列表
import bank from "@/views/bank/bank";
//考核管理列表
import assessment from "@/views/assessment/assessmentList";
//考核结果列表
import assessmenanalysis from "@/views/assessment/assessmenanalysis";
//培训资源管理
import trainResources from "@/views/trainResources/trainResources";


/**
 * 系统管理
 */
// 用户管理
import user from "@/views/system/user";
// 角色管理
import Role from "@/views/system/Role";

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
  routes: [
    {
      path: "/",
      name: "",
      component: login,
      hidden: true,
      meta: {
        requireAuth: false,
      },
    },
    {
      path: "/login",
      name: "登录",
      component: login,
      hidden: true,
      meta: {
        requireAuth: false,
      },
    },
    {
        path: "/register",
        name: "注册",
        component: register,
        hidden: true,
        meta: {
          requireAuth: false,
        },
      },
    {
      path: "/index",
      name: "首页",
      component: index,
      iconCls: "el-icon-tickets",
      children: [
        {
          path: "/charts/thinking",
          name: "首页",
          component: thinking,
          meta: {
            requireAuth: true,
          },
        },
        {
          path: "/charts/bankanalysis",
          name: "题库分析",
          component: bankanalysis,
          meta: {
            requireAuth: true,
          },
        },
        {
          path: "/bank/bank",
          name: "题库管理",
          component: bank,
          meta: {
            requireAuth: true,
          },
        },
        {
            path: "/resource/resource",
            name: "题库关联资源",
            component: resource,
            meta: {
              requireAuth: true,
            },
        },
        {
            path: "/assessment/assessmentList",
            name: "考核管理",
            component: assessment,
            meta: {
              requireAuth: true,
            },
        },

        {
            path: "/assessment/assessmenanalysis",
            name: "考核结果分析",
            component: assessmenanalysis,
            meta: {
              requireAuth: true,
            },
        },
        {
            path: "/trainResources/trainResources",
            name: "培训资源管理",
            component: trainResources,
            meta: {
              requireAuth: true,
            },
          },
        {
          path: "/system/Role",
          name: "角色管理",
          component: Role,
          meta: {
            requireAuth: true,
          },
        },
        
        {
          path: "/system/user",
          name: "用户管理",
          component: user,
          meta: {
            requireAuth: true,
          },
        },
      ],
    },
  ],
});
